package com.atguigu.config;

import com.atguigu.bean.Blue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.event.SimpleApplicationEventMulticaster;
import org.springframework.scheduling.annotation.EnableAsync;

/**
 * 容器创建过程分析:
 *
 */

/**
 * ApplicationListener: 监听容器中发布的事件。事件驱动模型开发;
 *  public interface ApplicationListener<E extends ApplicationEvent>
 *         监听ApplicationEvent 及其下面的子事件
 */
@Configuration
@EnableAsync
@ComponentScan(basePackages = {"com.atguigu.ext"})
public class ExtConfig {
//    @Bean
//    public SimpleApplicationEventMulticaster simpleApplicationEventMulticaster() {
//        return new SimpleApplicationEventMulticaster();
//    }
    @Bean
    public Blue blue() {
        return new Blue();
    }
}
